package server.demo.dto;

import server.demo.entity.Train;
import java.time.LocalDate;
import java.time.LocalTime;

public class TrainDTO {
    private Long id;
    private String trainNumber;
    private String trainType;
    private String startStationName;
    private String endStationName;
    private String startStationCode;
    private String endStationCode;
    private LocalTime departureTime;
    private LocalTime arrivalTime;
    private LocalDate travelDate;
    private String status;
    
    public TrainDTO() {}
    
    public TrainDTO(Train train) {
        this.id = train.getId();
        this.trainNumber = train.getTrainNumber();
        this.trainType = train.getTrainType().name();
        this.startStationName = train.getStartStation().getStationName();
        this.endStationName = train.getEndStation().getStationName();
        this.startStationCode = train.getStartStation().getStationCode();
        this.endStationCode = train.getEndStation().getStationCode();
        this.departureTime = train.getDepartureTime();
        this.arrivalTime = train.getArrivalTime();
        this.travelDate = train.getTravelDate();
        this.status = train.getStatus().name();
    }
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getTrainNumber() {
        return trainNumber;
    }
    
    public void setTrainNumber(String trainNumber) {
        this.trainNumber = trainNumber;
    }
    
    public String getTrainType() {
        return trainType;
    }
    
    public void setTrainType(String trainType) {
        this.trainType = trainType;
    }
    
    public String getStartStationName() {
        return startStationName;
    }
    
    public void setStartStationName(String startStationName) {
        this.startStationName = startStationName;
    }
    
    public String getEndStationName() {
        return endStationName;
    }
    
    public void setEndStationName(String endStationName) {
        this.endStationName = endStationName;
    }
    
    public String getStartStationCode() {
        return startStationCode;
    }
    
    public void setStartStationCode(String startStationCode) {
        this.startStationCode = startStationCode;
    }
    
    public String getEndStationCode() {
        return endStationCode;
    }
    
    public void setEndStationCode(String endStationCode) {
        this.endStationCode = endStationCode;
    }
    
    public LocalTime getDepartureTime() {
        return departureTime;
    }
    
    public void setDepartureTime(LocalTime departureTime) {
        this.departureTime = departureTime;
    }
    
    public LocalTime getArrivalTime() {
        return arrivalTime;
    }
    
    public void setArrivalTime(LocalTime arrivalTime) {
        this.arrivalTime = arrivalTime;
    }
    
    public LocalDate getTravelDate() {
        return travelDate;
    }
    
    public void setTravelDate(LocalDate travelDate) {
        this.travelDate = travelDate;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
}